import java.util.Date;

import junit.framework.TestCase;

import org.flynenu.core.dao.CommonDAO;
import org.flynenu.ums.common.bean.BeansEnum;
import org.flynenu.ums.common.bean.BeansManager;
import org.flynenu.ums.common.entity.City;
import org.flynenu.ums.common.entity.base.User;



public class SpringTest extends TestCase {
	private CommonDAO commonDao = (CommonDAO) BeansManager.instance().generateBean(BeansEnum.CommontDao);
	
	public void testCommonDao(){
		City city = new City();
		city.setCreateDate(new Date());
		city.setName("���Գ�ʽ");
		city.setProvinceId(0);
		
		User user = new User();
		user.setCardNum("127333");
		user.setCardType(1);
		user.setLoginName("bbbbb");
		user.setName("Lionel");
		user.setPassWord("aaa");
		
		
		commonDao.beginTransaction();
		commonDao.save(city);
		commonDao.save(user);
		commonDao.commitTransaction();
		commonDao.closeSession();
	}
	
	public void testRefren(){
		String str = (String) BeansManager.instance().generateBean(BeansEnum.CacheConfFilePath);
		assertFalse(str.equals(""));
		System.out.println(str);
	}
}
